<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Dryad - Jaiku Client Tool</title>
    </head>
    <body>
        Auth:
        <button id="auth.getRequestToken">1. getRequestToken!</button>
        <button id="auth.getUserAuthorizationURL">2. getUserAuthorizationURL!</button>
        <button id="auth.getAccessToken">3. getAccessToken!</button>

        <br />Post:
        <button id="post.post">Post Jaiku</button>


        <br /> Entry: 
        <button id="entry.get">Get Entry</button>
        <button id="entry.getActorOverview">Get ActorOverview</button>
        <button id="entry.getActorOverviewSince">Get ActorOverviewSince</button>

        <br /> Actor:
        <button id="actor.get">Get</button>
        <button id="actor.getContacts">Get Contacts</button>

        <br /> Other:
        <button id="explore">Get Explorer</button>


        <script type="text/javascript" src="js/AIRAliases.js"></script>
        <script type="text/javascript" src="js/AIRIntrospector.js"></script>
        <script type="text/javascript" src="js/mootools-1.2.3-core-nc.js"></script>
        <script type="text/javascript" src="js/oauth.js"></script>
        <script type="text/javascript" src="js/sha1.js"></script>
        <script type="text/javascript" src="js/Jaiku.js"></script>
        <script type="text/javascript">
            var openUrlWithSystemDefaultBrowser = function(url) {
                air.navigateToURL(new air.URLRequest(url));
            };

            $('post.post').addEvent('click', function(e) {
                Jaiku.post.post({
                    message: prompt('Enter u\'s message:', 'Hello, world! - from Dryad'),
                    location: "Hangzhou, China",
                    icon: "",
                    nick: "mingcheng"
                });
            });

            $('actor.getContacts').addEvent('click', function(e) {
                    Jaiku.actor.getContacts(prompt('user name:', 'mingcheng'));
            });

            $('actor.get').addEvent('click', function(e) {
                Jaiku.actor.get({nick: prompt('user name:', 'mingcheng')});
            });


            $('entry.get').addEvent('click', function(e) {
                    Jaiku.entry.get(prompt('user name:', 'mingcheng'));
            });


            $('entry.getActorOverview').addEvent('click', function(e) {
                    Jaiku.entry.getActorOverview({nick: prompt('user name:', 'mingcheng')});
            });

            $('entry.getActorOverviewSince').addEvent('click', function(e) {
                    Jaiku.entry.getActorOverviewSince({nick: prompt('user name:', 'mingcheng')});
            });


            $('explore').addEvent('click', function(e) {
                    Jaiku.explore();
            });
/*
            Jaiku.auth.getRequestToken({
                onSuccess: function() {
                    $('get').addEvent('click', function(e) {
                        Jaiku.auth.getAccessToken();
                        jaiku.
                    });
                    openUrlWithSystemDefaultBrowser(Jaiku.auth.getUserAuthorizationURL());
                }
            });
*/
        </script>
    </body>
</html>
